/**
 * @author wangpeizhi
 */
import request from '@/utils/request'
/**
 * 字典
 */
// 获取系统分类字典
export function getDictByCode(dictCode) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/sysDictionary/getDictByCode',
    method: 'get',
    params: {
      dictCode
    }
  })
}
/**
 * 获取角色列表
 * @param {*} query
 */
export function roleList(query) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/role/queryPlatformPage',
    method: 'get',
    params: query
  })
}
/**
 * 创建角色
 * @param {*} data
 */
export function createRole(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/role/insert',
    method: 'post',
    data
  })
}
/**
 * 删除角色
 * @param {*} ids
 */
export function deleteRole(ids) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/role/delete',
    method: 'get',
    params: {
      ids
    }
  })
}
/**
 * 更新角色
 * @param {*} data
 */
export function updateRole(data) {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/role/update',
    method: 'post',
    data
  })
}
/**
 * 获取权限树
 */
export function getTreeAndSuper() {
  return request({
    baseURL: '/API-ENTERPRISE-BACKEND/',
    url: '/backend/orgInfo/getTree',
    method: 'post'
  })
}
